package work.mediway.mdm.biz.service.patient.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import work.mediway.mdm.core.page.QueryRequest;
import work.mediway.mdm.biz.entity.patient.PatientConfig;
import work.mediway.mdm.biz.mapper.patient.PatientConfigMapper;
import work.mediway.mdm.biz.service.patient.PatientConfigService;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2020/12/21
 */
@Transactional(rollbackFor = Exception.class)
@Service
public class PatientConfigServiceImpl extends ServiceImpl<PatientConfigMapper, PatientConfig> implements PatientConfigService {

    @Override
    public Page<PatientConfig> pagePatientWeight(PatientConfig patientConfig, QueryRequest queryRequest) {
        Page<PatientConfig> page = new Page<>(queryRequest.getCurrent(), queryRequest.getSize());
        page.setRecords(this.baseMapper.pagePatientWeight(null, patientConfig));
        return page;
    }
}
